package gameUi
{
	import com.greensock.TweenLite;
	import com.greensock.TweenMax;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import flash.utils.setTimeout;
	
	import gameUi.panel.BupChipUI;
	import gameUi.panel.ChoosePanel;
	import gameUi.panel.InfoPanel;
	import gameUi.panel.IsumAllPanel;
	import gameUi.panel.IsumPanel;
	import gameUi.panel.SurePanel;

	public class GameUi extends BlackJackMC
	{
		private var ruleW:Number;//规则面板原始宽
		private var ruleH:Number;//规则面板原始高
		private var uiWH:Number;//游戏场景宽高比
		
		private var chipMin:Number;//最最小注额
		private var chipMax:Number;//最大注额
		
		private var _inOneGame:Boolean;//是否正在一局游戏中
		
		private var cardChipBoxArray:Vector.<CardChipBox>;//下注发牌区域管理数组
		private var chipActionArray:Array;//下注动作数组（用于回复按钮）
		
		private var isumBoxArray:Vector.<Isume>;//保险筹码容器数组
		
		private var buyChipUI:BupChipUI;//兑换筹码界面
		
		private var canChip:Boolean = true;//是否能够下注（游戏进行中不能下注）
		
		private var gameState:int;//游戏进度值，管理游戏按钮出现
		private var _allChipNum:Number;//当前总下注筹码数
		
		private var _callCardNum:int = -1;//当前操作牌索引下标
		private var chipCallList:Array;//叫牌使用筹码数组
		private var cardPartBoxArray:Vector.<CardChipBox>;//下注发牌区域管理数组
		
		
		private var surePanel:SurePanel;
		private var isumPanel:IsumPanel;
		private var isumAllPanel:IsumAllPanel;
		
		private var _tipOfSurePanel:Boolean = true;//当局是否提示大于等于17点
		private var _tipOfIsumAllPanel:Boolean = true;//当局是否还未提示买保险
		private var _tipOfIsumPanel:Boolean = true;//当局是否提示买保险
		private var needIsumeTip:Boolean;//庄家是否是A
		private var _allBuyIsum:int;//是否全部买保险(默认0，全部是1，全部否2)
		
		private var _partCardOver:Boolean;//第一轮发牌完毕，可以开始叫牌
		
		private var _showPanel:Boolean;//面板是否出现，为true时屏蔽其他按钮点击动作
		private var _tipsIsum:Boolean;//是否提示买保险，不提示时忽略保险策略（有选项面板控制）
//		
//		private var isumArray:Vector.<MovieClip>;
		
		private var _tf0:TextFormat;
		
		public function GameUi()
		{
			cardChipBoxArray=new Vector.<CardChipBox>();
			chipActionArray = new Array();
			chipCallList = new Array();
			cardPartBoxArray = new Vector.<CardChipBox>();
			isumBoxArray = new Vector.<Isume>();
			surePanel = new SurePanel();
			isumPanel = new IsumPanel();
			isumAllPanel = new IsumAllPanel();
			buyChipUI = new BupChipUI();
			_tf0 = new TextFormat();
			_tf0.size = 9;
			uiWH = this.width/this.height;
			chipMin = BlackJack.chipMin;
			chipMax = BlackJack.chipMax;
//			init();
			
		}
		
		public function initGame():void{
			//提示断线时间
			InfoPanel.getInstance().showInfo(6);
			//---------------------
			//初始化下注区域管理
			for(i = 5;i<11;i++){
				this["cmdChip"+i].visible = false;
			}
			var cardChipBox:CardChipBox = new CardChipBox(5,this["pointCard5"],this["chip5"],this["arrw5"],this["cmdChip5"].playTableState,null,true);
			cardPartBoxArray.push(cardChipBox);
			for(i = 6;i<11;i++){
				cardChipBox = new CardChipBox(i,this["pointCard"+i],this["chip"+i],this["arrw"+i],this["cmdChip"+i].playTableState);
				cardPartBoxArray.push(cardChipBox);
			}
			for(var i:int = 0;i<5;i++){
				cardChipBox = new CardChipBox(i,this["pointCard"+i],this["chip"+i],this["arrw"+i],this["cmdChip"+i].playTableState,cardPartBoxArray[i+1]);
				cardChipBoxArray.push(cardChipBox);
				
				var isume:Isume = new Isume(this["ichip"+i]);
				isumBoxArray.push(isume);
			}
//			cmdChip5.visible = false;
			//初始化值
			ruleW = rule.width;
			ruleH = rule.height;
			//初始化上方展示筹码面值
			c0.chip.face.chipface.chipnumber.gotoAndStop(4);
			c1.chip.face.chipface.chipnumber.gotoAndStop(7);
			c2.chip.face.chipface.chipnumber.gotoAndStop(8);
			c3.chip.face.chipface.chipnumber.gotoAndStop(11);
			c4.chip.face.chipface.chipnumber.gotoAndStop(12);
			c5.chip.face.chipface.chipnumber.gotoAndStop(14);
			c6.chip.face.chipface.chipnumber.gotoAndStop(16);
			c7.chip.face.chipface.chipnumber.gotoAndStop(19);
			c8.chip.face.chipface.chipnumber.gotoAndStop(20);
			c9.chip.face.chipface.chipnumber.gotoAndStop(21);
			//初始化下注区域
			for(i = 0;i < 6;i++){
				this["cmdChip"+i].buttonMode = true;
				this["cmdChip"+i].mouseChildren = false;
				this["pointCard"+i].mouseChildren = false;
				this["pointCard"+i].mouseEnabled = false;
				this["chip"+i].mouseChildren = false;
				this["chip"+i].mouseEnabled = false;
			}
			//初始化规则展示板
			var tf:TextFormat = new TextFormat();
			tf.bold = true;
			tf.size = 24;
			rule.textRuleShow.visible = false;
			rule.textRule.defaultTextFormat = tf;
			rule.textRule.text = "最大赌注：\n     "+ chipMax +"\n最小赌注：\n        " + chipMin;
			rule.textRuleShow.text = "-游戏用六副牌进行\n-庄家必须在17点停止叫牌-玩家每一门可在仅有两张牌时双倍加注\n-一手牌仅可分牌一次\n-将A分牌或者双倍加注，那手牌仅可再发一张牌\n-分牌后允许双倍加注\n-分牌后没有天生21点\n-天生21点的赔率是1.5倍\n-如庄家有天生21点，保赔率是2赔1\n-其他赢法赔率是1赔1";
			//初始化游戏按钮状态
			gameStateChange(0);
			SoundManager.instance.play("place_your_bets_please");
			
			addListner();
			onResize();
		}
		
		//添加侦听
		private function addListner():void{
			BlackJack._stage.addEventListener(Event.RESIZE,onResize);
			
			cmdChip0.addEventListener(MouseEvent.MOUSE_DOWN,onClickCmdChip0);
			cmdChip1.addEventListener(MouseEvent.MOUSE_DOWN,onClickCmdChip1);
			cmdChip2.addEventListener(MouseEvent.MOUSE_DOWN,onClickCmdChip2);
			cmdChip3.addEventListener(MouseEvent.MOUSE_DOWN,onClickCmdChip3);
			cmdChip4.addEventListener(MouseEvent.MOUSE_DOWN,onClickCmdChip4);
			
			rule.addEventListener(MouseEvent.ROLL_OVER,showRule);
			rule.addEventListener(MouseEvent.ROLL_OUT,showRuleOver);
			
			//tittle监听
			tittle.cmdChip.addEventListener(MouseEvent.CLICK,onClickCmdChip);
			tittle.cmdRecharge.addEventListener(MouseEvent.CLICK,onClickCmdRecharge);
			tittle.cmdSound.addEventListener(MouseEvent.CLICK,onClickCmdSound);
			tittle.cmdInfo.addEventListener(MouseEvent.CLICK,onClickCmdInfo);
			tittle.cmdChoose.addEventListener(MouseEvent.CLICK,onClickCmdChoose);
			tittle.cmdOut.addEventListener(MouseEvent.CLICK,onClickCmdOut);
			
			//按钮监听
			btnBox.cmdDeal.addEventListener(MouseEvent.CLICK,onClickCmdDeal);
			btnBox.cmdCall.addEventListener(MouseEvent.CLICK,onClickCmdCall);
			btnBox.cmdRepeat.addEventListener(MouseEvent.CLICK,onClickCmdRepeat);
			btnBox.cmdDouble.addEventListener(MouseEvent.CLICK,onClickCmdDouble);
			btnBox.cmdDouble1.addEventListener(MouseEvent.CLICK,onClickCmdDouble1);
			btnBox.cmdStop.addEventListener(MouseEvent.CLICK,onClickCmdStop);
			btnBox.cmdRepeatChip.addEventListener(MouseEvent.CLICK,onClickCmdRepeatChip);
			btnBox.cmdRecover.addEventListener(MouseEvent.CLICK,onClickCmdRecover);
			btnBox.cmdPartCard.addEventListener(MouseEvent.CLICK,onClickCmdPartCard);
			btnBox.cmdClearAllChip.addEventListener(MouseEvent.CLICK,onClickCmdClearAllChip);
		}
		
		private function onResize(e:Event=null):void{
			if(BlackJack._stage.stageWidth/BlackJack._stage.stageHeight > uiWH){
				this.height = BlackJack._stage.stageHeight;
				this.width = this.height * uiWH;
			}else{
				this.width = BlackJack._stage.stageWidth;
				this.height = this.width / uiWH;
			}
			this.x = (BlackJack._stage.stageWidth - this.width)/2;
			this.y = (BlackJack._stage.stageHeight - this.height)/2;
		}
		
		/**
		 * 游戏按钮出现管理
		 **/
		public function gameStateChange(state:int):void{
			trace("gameStateChange == ",state);
			gameState = state;
			//先全部按钮隐藏
			for(var i:int = 0;i<btnBox.numChildren;i++){
				btnBox.getChildAt(i).visible = false;
			}
			switch(gameState){
				case 0://未下注时
					for(i = 0;i<5;i++){
						this["cmdChip"+i].playTableState.visible = true;
					}
					while(pointPanel.numChildren>0){
						pointPanel.removeChildAt(0);
					}
					while(pointChipWin.numChildren>0){
						pointChipWin.removeChildAt(0);
					}
					for(i = 0;i<cardChipBoxArray.length;i++){
						cardChipBoxArray[i].initCardChipBox();
						cardPartBoxArray[i+1].initCardChipBox();
					}
					for(i = 0;i<isumBoxArray.length;i++){
						isumBoxArray[i].initIsume();
					}
					cardPartBoxArray[0].initCardChipBox();
					canChip = true;
					_tipOfSurePanel = true;
					_tipOfIsumAllPanel = true;
					_tipOfIsumPanel = true;
					_isDealingOver = false;
					_partCardOver = false;
					_callCardNum = -1;
					winChipNum = 0;
					_allChipNum = 0;
					_allBuyIsum = 0;
					
					tittle.cmdAllChip.text = _allChipNum.toString();
					break;
				case 1://游戏开始下注时
					btnBox.cmdDeal.visible = true;
					btnBox.cmdDouble.visible = true;
					btnBox.cmdRecover.visible = true;
					btnBox.cmdClearAllChip.visible = true;
					break;
				case 2://游戏进行可赌倍时
					for(i = 0;i<5;i++){
						this["cmdChip"+i].playTableState.visible = false;
					}
					btnBox.cmdCall.visible = true;
					btnBox.cmdStop.visible = true;
					btnBox.cmdDouble1.visible = true;
					break;
				case 3://游戏进行出现对子时
					btnBox.cmdCall.visible = true;
					btnBox.cmdStop.visible = true;
					btnBox.cmdDouble1.visible = true;
					btnBox.cmdPartCard.visible = true;
					break;
				case 4://重复发牌下注
					for(i = 0;i<5;i++){
						this["cmdChip"+i].playTableState.visible = true;
					}
					while(pointPanel.numChildren>0){
						pointPanel.removeChildAt(0);
					}
					while(pointChipWin.numChildren>0){
						pointChipWin.removeChildAt(0);
					}
					for(i = 0;i<cardChipBoxArray.length;i++){
						cardChipBoxArray[i].initCardChipBox();
						cardPartBoxArray[i+1].initCardChipBox();
					}
					for(i = 0;i<isumBoxArray.length;i++){
						isumBoxArray[i].initIsume();
					}
					cardPartBoxArray[0].initCardChipBox();
					btnBox.cmdRepeat.visible = true;
					btnBox.cmdRepeatChip.visible = true;
					
					canChip = true;
					_tipOfSurePanel = true;
					_tipOfIsumAllPanel = true;
					_tipOfIsumPanel = true;
					_isDealingOver = false;
					_partCardOver = false;
					_callCardNum = -1;
					winChipNum = 0;
					_allChipNum = 0;
					_allBuyIsum = 0;
					tittle.cmdAllChip.text = _allChipNum.toString();
					SoundManager.instance.play("place_your_bets_please");
					break;
				case 5://发牌时或者正在结算时
					
					break;
				case 6://游戏进行不可赌倍时
					for(i = 0;i<5;i++){
						this["cmdChip"+i].playTableState.visible = false;
					}
					btnBox.cmdCall.visible = true;
					btnBox.cmdStop.visible = true;
					break;
			}
		}
		
	//tittle栏监听-----------------------------------------------------------------------
		//点击兑换筹码
		private function onClickCmdChip(e:MouseEvent):void{
			if(BlackJack._stage.contains(buyChipUI)){
				BlackJack._stage.removeChild(buyChipUI);
			}else{
				buyChipUI.x = (BlackJack._stage.stageWidth - buyChipUI.width)/2;
				buyChipUI.y = (BlackJack._stage.stageHeight - buyChipUI.height)/2;
				BlackJack._stage.addChild(buyChipUI);
			}
		}
		//点击充值
		private function onClickCmdRecharge(e:MouseEvent):void{
			
		}
		//点击声音
		private function onClickCmdSound(e:MouseEvent):void{
			SoundManager.instance.pause();
		}
		//点击说明
		private function onClickCmdInfo(e:MouseEvent):void{
			
		}
		//点击选项
		private function onClickCmdChoose(e:MouseEvent):void{
//			ChoosePanel.getInstance().showPanel();
		}
		//点击退出
		private function onClickCmdOut(e:MouseEvent):void{
			
		}
	//----------------------------------------------------------------------------------
		
	//功能按钮---------------------------------------------------------------------------
		//点击发牌
		private function onClickCmdDeal(e:MouseEvent = null):void{
			if(_showPanel) return;
			trace("点击发牌");
//			deal(1,2,1);/////////////////////////////////////////////////
			var chipNumList:Array = new Array();
			for(var i:int=0;i<cardChipBoxArray.length;i++){
				chipNumList.push(cardChipBoxArray[i].chipNum);
//				if(cardChipBoxArray[i].chipNum != 0) chipCallList.push(i);
			}
			chipCallList = chipNumList;
			gameStateChange(5);
			BlackJack.cardGameSocketSender.chipOverPack(chipNumList);
			SoundManager.instance.play("snd_buttonPress");
		}
		//点击叫牌
		private function onClickCmdCall(e:MouseEvent):void{
			if(_showPanel) return;
			SoundManager.instance.play("snd_buttonPress");
			if(_callCardNum > 5){
				if(cardPartBoxArray[_callCardNum-5].cardNum >= 21) return;
				if(_tipOfSurePanel && cardPartBoxArray[_callCardNum-5].cardNum >= 17){
					showSurePanel();
					return;
				}
			}else if(_callCardNum>=0 && _callCardNum<5){
				if(cardChipBoxArray[_callCardNum].cardNum >= 21) return;
				if(_tipOfSurePanel && cardChipBoxArray[_callCardNum].cardNum >= 17){
					showSurePanel();
					return;
				}
			}
			trace("叫牌了！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！");
			addCardPack();
		}
		/**叫牌*/
		public function addCardPack():void{
			BlackJack.cardGameSocketSender.addardPack(_callCardNum);
			gameStateChange(5);
		}
		//点击重复与发牌
		private function onClickCmdRepeat(e:MouseEvent):void{
			if(_showPanel) return;
			SoundManager.instance.play("snd_buttonPress");
			if(!onClickCmdRepeatChip()){
				gameStateChange(0);
				return;
			}
			onClickCmdDeal();
		}
		//点击双倍
		private function onClickCmdDouble(e:MouseEvent):void{
			if(_showPanel) return;
			SoundManager.instance.play("snd_buttonPress");
			var tempNum:int = 0;
			for(var i:int=0;i<cardChipBoxArray.length;i++){
				if(cardChipBoxArray[i].chipNum*2 > chipMax){
					InfoPanel.getInstance().showInfo(5);
					return;
				}
				if(cardChipBoxArray[i].chipNum != 0 &&cardChipBoxArray[i].chipNum*2 < chipMin){
					InfoPanel.getInstance().showInfo(5);
					return;
				}
				tempNum += cardChipBoxArray[i].chipNum;
			}
			if(allChipNum + tempNum > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return;
			}
			var tempArray:Array = new Array();
			for(i=0;i<cardChipBoxArray.length;i++){
				if(cardChipBoxArray[i].chipNum>0){
					cardChipBoxArray[i].addChip(cardChipBoxArray[i].chipNum);
					tempArray.push(i);
				}
			}
			chipActionArray.push(tempArray);
		}
		//点击赌倍
		private function onClickCmdDouble1(e:MouseEvent):void{
			if(_showPanel) return;
			if(_callCardNum > 5){
				if(cardPartBoxArray[_callCardNum-5].cardNum >= 21) return
				if(cardPartBoxArray[_callCardNum-5].chipNum > Number(tittle.txtMoney.text)){
					InfoPanel.getInstance().showInfo(1);
					return;
				}
			}else if(_callCardNum>=0 && _callCardNum<5){
				if(cardChipBoxArray[_callCardNum].cardNum >= 21) return;
				if(cardChipBoxArray[_callCardNum].chipNum > Number(tittle.txtMoney.text)){
					InfoPanel.getInstance().showInfo(1);
					return;
				}
			}
			setTimeout(beginDoubleCall,2000);
			SoundManager.instance.play("double");
			gameStateChange(5);
		}
		//点击停止叫牌
		public function onClickCmdStop(e:MouseEvent = null):void{
			if(_showPanel) return;
//			cardChipBoxArray[chipCallList[_callCardNum]].closeCallCardArrow();
//			cardChipBoxArray[_callCardNum].showCallCardArrow();
			SoundManager.instance.play("snd_buttonPress");
			if(_callCardNum > 5){
				if(cardPartBoxArray[_callCardNum-5].cardNum >= 21) return;
			}else if(_callCardNum>=0 && _callCardNum<5){
				if(cardChipBoxArray[_callCardNum].cardNum >= 21) return;
			}
			BlackJack.cardGameSocketSender.stopCardPack(_callCardNum);
			gameStateChange(5);
		}
		//点击重复下注
		private function onClickCmdRepeatChip(e:MouseEvent = null):Boolean{
			if(_showPanel) return false;
			SoundManager.instance.play("snd_buttonPress");
			if(chipCallList.length == 0) return false;
			var tempNum:int = 0;
			for(var i:int=0;i<chipCallList.length;i++){
				tempNum += chipCallList[i];
			}
			if(tempNum > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return false;
			}
			for(i=0;i<chipCallList.length;i++){
				cardChipBoxArray[i].addChip(chipCallList[i]);
			}
			chipCallList = [];
			gameStateChange(1);
			return true;
		}
		//点击复原
		private function onClickCmdRecover(e:MouseEvent):void{
			if(_showPanel) return;
			SoundManager.instance.play("snd_buttonPress");
			if(chipActionArray.length == 0) return;
			var tempArray:Array = chipActionArray.pop();
			for(var i:int=0;i<tempArray.length;i++){
				cardChipBoxArray[tempArray[i]].returnChip();
			}
		}
		//点击分牌
		private function onClickCmdPartCard(e:MouseEvent):void{
			if(_showPanel) return;
			if(cardChipBoxArray[_callCardNum].chipNum > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return;
			}
			SoundManager.instance.play("snd_buttonPress");
			cardChipBoxArray[_callCardNum].packCard();
			gameStateChange(5);
			setTimeout(sendPartCard,500);
		}
		private function sendPartCard():void{
			trace("分牌_callCardNum",_callCardNum);
			BlackJack.cardGameSocketSender.separateCardPack(_callCardNum);
		}
		//点击取消所有下注
		private function onClickCmdClearAllChip(e:MouseEvent):void{
			if(_showPanel) return;
			SoundManager.instance.play("snd_buttonPress");
			for(var i:int=0;i<cardChipBoxArray.length;i++){
				cardChipBoxArray[i].clearAllChip();
			}
			chipActionArray = new Array();
		}
	//----------------------------------------------------------------------------------
		
		/**发送刚好21点包*/
		public function point21Pack():void{
			BlackJack.cardGameSocketSender.point21Pack(_callCardNum);
		}
		
//		/**发送爆牌包*/
//		public function sendBoonCardPack():void{
//			BlackJack.cardGameSocketSender.boonCardPack(_callCardNum);
//		}
		
	//点击下注————————————————————————————————————————
		private function onClickCmdChip0(e:MouseEvent):void{
			if(!canChip || !checkChipNumInMax(0) || !checkChipNumOfAllChipNum()) return;
			gameStateChange(1);
			cmdChip0.playTableState.visible = false;
			cardChipBoxArray[0].addChip(BlackJack.chipBox.chooseChipNum);
			chipActionArray.push([0]);
			SoundManager.instance.play("snd_chipPlace_soft");
		}
		
		private function onClickCmdChip1(e:MouseEvent):void{
			if(!canChip || !checkChipNumInMax(1) || !checkChipNumOfAllChipNum()) return;
			gameStateChange(1);
			cmdChip1.playTableState.visible = false;
			cardChipBoxArray[1].addChip(BlackJack.chipBox.chooseChipNum);
			chipActionArray.push([1]);
			SoundManager.instance.play("snd_chipPlace_soft");
		}
		
		private function onClickCmdChip2(e:MouseEvent):void{
			if(!canChip || !checkChipNumInMax(2) || !checkChipNumOfAllChipNum()) return;
			gameStateChange(1);
			cmdChip2.playTableState.visible = false;
			cardChipBoxArray[2].addChip(BlackJack.chipBox.chooseChipNum);
			chipActionArray.push([2]);
			SoundManager.instance.play("snd_chipPlace_soft");
		}
		
		private function onClickCmdChip3(e:MouseEvent):void{
			if(!canChip || !checkChipNumInMax(3) || !checkChipNumOfAllChipNum()) return;
			gameStateChange(1);
			cmdChip3.playTableState.visible = false;
			cardChipBoxArray[3].addChip(BlackJack.chipBox.chooseChipNum);
			chipActionArray.push([3]);
			SoundManager.instance.play("snd_chipPlace_soft");
		}
		
		private function onClickCmdChip4(e:MouseEvent):void{
			if(!canChip || !checkChipNumInMax(4) || !checkChipNumOfAllChipNum()) return;
			gameStateChange(1);
			cmdChip4.playTableState.visible = false;
			cardChipBoxArray[4].addChip(BlackJack.chipBox.chooseChipNum);
			chipActionArray.push([4]);
			SoundManager.instance.play("snd_chipPlace_soft");
		}
		
		private function checkChipNumInMax(index:int):Boolean{
			if(BlackJack.chipBox.chooseChipNum+cardChipBoxArray[index].chipNum > chipMax || BlackJack.chipBox.chooseChipNum+cardChipBoxArray[index].chipNum < chipMin){
				InfoPanel.getInstance().showInfo(5);
				return false;
			}else{
				return true;
			}
		}
		
		private function checkChipNumOfAllChipNum():Boolean{
			trace("BlackJack.chipBox.chooseChipNum + _allChipNum <= Number(tittle.txtMoney.text)",BlackJack.chipBox.chooseChipNum , _allChipNum , Number(tittle.txtMoney.text));
			if(BlackJack.chipBox.chooseChipNum + _allChipNum > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return false;
			}else{
				return true;
			}
//			return BlackJack.chipBox.chooseChipNum + _allChipNum <= Number(tittle.txtMoney.text);
		}
	//-----------------------------------------------------------------------------------
		
		//展示规则
		private function showRule(e:MouseEvent):void{
			rule.textRule.visible = false;
			rule.textRuleShow.visible = true;
			TweenMax.to(rule, 0.5, { width:ruleW*6,height:ruleH*6});
		}
		
		private function showRuleOver(e:MouseEvent):void{
			TweenMax.to(rule, 0.5, { width:ruleW,height:ruleH,onComplete:showRuleText});
		}
		
		private function showRuleText():void{
			rule.textRule.visible = true;
			rule.textRuleShow.visible = false;
		}
		
//		/**
//		 * 发牌完毕，开始叫牌
//		 **/
//		public function beginCall():void{
//			cardChipBoxArray[_callCardNum].showCallCardArrow();
//		}
		
		/**
		 * 发牌完毕，开始赌倍
		 **/
		private function beginDoubleCall():void{
//			if(chipCallList.length>_callCardNum + 1 && cardChipBoxArray[chipCallList[_callCardNum + 1]]){
			if(_callCardNum>5 && _callCardNum<=11){
				cardPartBoxArray[_callCardNum-5].addChip(cardPartBoxArray[_callCardNum-5].chipNum);
			}else if(_callCardNum>=0 && _callCardNum<5){
				cardChipBoxArray[_callCardNum].addChip(cardChipBoxArray[_callCardNum].chipNum);
			}
				BlackJack.cardGameSocketSender.doubleChipPack(_callCardNum);
//				cardChipBoxArray[chipCallList[_callCardNum]].closeCallCardArrow();
//				_callCardNum++;
//			}
		}
		
		private var dealActionArr:Array = new Array();//发牌动画队列
		
		private var _dealing:Boolean;//是否正在发牌
		
		/**
		 * 发牌 
		 * @param cardType 花色 黑桃0 红条1 方片2 梅花3
		 * @param cardNum 数字 1~13 由2到A
		 * @param cardPoint 牌位置索引 从左到右0~4，5表示从庄家位置
		 * 
		 */
		public function deal(cardType:int,cardNum:int,cardPoint:int):void{
			canChip = false;
			
			dealActionArr.push([cardType,cardNum,cardPoint]);
			addEventListener(Event.ENTER_FRAME,dealAction);
		}
		
		private var _isDealingOver:Boolean;//是否发牌完毕
		//发牌动画
		private function dealAction(e:Event):void{
			if(dealActionArr.length == 0){
				removeEventListener(Event.ENTER_FRAME,dealAction);
				_isDealingOver = true;
//				beginCall();
				return;
			}
			if(!_dealing){
				var tempArr:Array = dealActionArr[0];
				if(tempArr[2] == -1) return;
				dealActionArr.splice(0,1);
				if(tempArr[2]<5){
					var card:Card = new Card(tempArr[0],tempArr[1]);
					cardChipBoxArray[tempArr[2]].deal(card,tempArr[1]);
					_dealing = true;
					gameStateChange(5);
				}
				else if(tempArr[2]==5){//发庄家牌
					card = new Card(tempArr[0],tempArr[1]);
					cardPartBoxArray[0].deal(card,tempArr[1]);
					_dealing = true;
					gameStateChange(5);
				}
				else if(tempArr[2]>5 && tempArr[2]<11){//分牌组补拍
					card = new Card(tempArr[0],tempArr[1]);
					cardPartBoxArray[tempArr[2]-5].deal(card,tempArr[1]);
					_dealing = true;
					gameStateChange(5);
				}
			}
		}
		
		private var tempChangeCallNum:int;
		private var oldCallNum:int;
		/**
		 * 当前操作牌组显示
		 **/
		public function changeCallCardNum(num:int):void{
			_partCardOver = true;
			tempChangeCallNum = num;
			oldCallNum = num;
			
//			if( _callCardNum!= -1){
//				if(_callCardNum>=0 && _callCardNum<5){
//					BlackJack.cardGameSocketSender.pointPack(cardChipBoxArray[_callCardNum].cardNum,_callCardNum);//告知服务器牌点数
//				}else if(_callCardNum>5 && _callCardNum<=10){
//					BlackJack.cardGameSocketSender.pointPack(cardPartBoxArray[_callCardNum-5].cardNum,_callCardNum);//告知服务器牌点数
//				}
//			}
			
			addEventListener(Event.ENTER_FRAME,waitChangeCallNum);
			
		}
		
		private function waitChangeCallNum(e:Event):void{
			if(_isDealingOver && !_dealing){
				changeCallNum();
				removeEventListener(Event.ENTER_FRAME,waitChangeCallNum);
			}
		}
		
		private function changeCallNum():void{
			if(_isDealingOver){
				if(_callCardNum != -1){
					if(_callCardNum>=0 && _callCardNum<6){
						cardChipBoxArray[_callCardNum].closeCallCardArrow();
					}else if(_callCardNum>=6 && _callCardNum<11){
						cardPartBoxArray[_callCardNum-5].closeCallCardArrow();
					}
				}
				_callCardNum = tempChangeCallNum;
				trace("_callCardNum:",_callCardNum);
				if(_callCardNum>=0 && _callCardNum<6){
					cardChipBoxArray[_callCardNum].showCallCardArrow();
					if(_tipOfIsumAllPanel && cardPartBoxArray[0].cardNum == 11){
						trace("检测是否买保险");
						checkIsume();
						return;
					}
					if(cardChipBoxArray[_callCardNum].cardPointSound()){
						setTimeout(sendPoint,1000);
					}else{
						sendPoint();
					}
					trace("是否分牌",cardChipBoxArray[_callCardNum].checkPack());
					if(!cardChipBoxArray[_callCardNum].checkPack()) setTimeout(gameStateChange,0,2);
					cardChipBoxArray[_callCardNum].check21Point();
				}else if(_callCardNum>=6 && _callCardNum<11){
					cardPartBoxArray[_callCardNum-5].showCallCardArrow();
					if(cardPartBoxArray[_callCardNum-5].cardPointSound()){
						setTimeout(sendPoint,2000);
					}else{
						sendPoint();
					}
					if(cardPartBoxArray[_callCardNum-5].cardArrayLenth == 2){
						setTimeout(gameStateChange,0,2);
					}else if(cardPartBoxArray[_callCardNum-5].cardArrayLenth > 2){
						setTimeout(gameStateChange,0,6);
					}
					cardPartBoxArray[_callCardNum-5].check21Point();
				}else if(_callCardNum == -1){
					BlackJack.cardGameSocketSender.cardNumPack(cardPartBoxArray[0].bankerPoint);
					BlackJack.cardGameSocketSender.oneGameOverPack();
				}
			}
		}

		private function sendPoint():void{
			if(tempChangeCallNum == -1){
				gameStateChange(5);
				if(oldCallNum>=0 && oldCallNum<5){
					cardChipBoxArray[oldCallNum].closeCallCardArrow();
				}else if(oldCallNum>5 && oldCallNum<=10){
					cardPartBoxArray[oldCallNum-5].closeCallCardArrow();
				}
				//				return;
			}
		}
		
		/**
		 * 庄家付筹码动画
		 * */
		public function bankerChipPay(num:Number):void{
			winChipNum += num;
			trace("庄家付款：",num);
			var _chipMC:MovieClip = chipMC(num);
			
//			var beginPoint:Point = pointChipWin.globalToLocal(new Point(pointBankerChip.x,pointBankerChip.y));
//			_chipMC.x = beginPoint.x;
//			_chipMC.y = beginPoint.y;
			_chipMC.x = pointBankerChip.x - pointChipWin.x;
			_chipMC.y = pointBankerChip.y - pointChipWin.y;
			pointChipWin.addChild(_chipMC);
			TweenLite.to(_chipMC,0.5,{x:0,y:0});
			
			setTimeout(showNumChipWin,500);
		}
		
		//玩家筹码返回实例
		public function playerChipCome(num:Number):void{
			trace("玩家付款：",num);
			winChipNum += num;
			
			setTimeout(showNumChipWin,500);
		}
		
		private function chipMC(num:Number):MovieClip{
			var _chipMC:MovieClip = new MovieClip();
			
			var tempChipNum:Number = num;
			var i:int
			var chip:ChipObject;
			
			var numText:Sprite = pointTextShow(num);
			
			var tempNum:Number = Math.floor(tempChipNum/50000);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(12);
				chip.chipNumber.gotoAndStop(27);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*50000;
			
			tempNum = Math.floor(tempChipNum/10000);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(11);
				chip.chipNumber.gotoAndStop(24);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*10000;
			
			tempNum = Math.floor(tempChipNum/5000);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(10);
				chip.chipNumber.gotoAndStop(23);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*5000;
			
			tempNum = Math.floor(tempChipNum/1000);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(9);
				chip.chipNumber.gotoAndStop(20);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*1000;
			
			tempNum = Math.floor(tempChipNum/500);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(8);
				chip.chipNumber.gotoAndStop(19);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*500;
			
			tempNum = Math.floor(tempChipNum/100);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(7);
				chip.chipNumber.gotoAndStop(16);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*100;
			
			tempNum = Math.floor(tempChipNum/25);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(6);
				chip.chipNumber.gotoAndStop(14);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*25;
			
			tempNum = Math.floor(tempChipNum/10);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(5);
				chip.chipNumber.gotoAndStop(12);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*10;
			
			tempNum = Math.floor(tempChipNum/5);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(4);
				chip.chipNumber.gotoAndStop(11);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*5;
			trace("-----------",tempChipNum,"__");
			tempNum = Math.floor(tempChipNum/1);
			for(i=0;i<tempNum;i++){
				chip = new ChipObject();
				chip.gotoAndStop(3);
				chip.chipNumber.gotoAndStop(8);
				_chipMC.addChild(chip);
			}
			tempChipNum -= tempNum*1;
			
			if(tempChipNum == 0.5){
				chip = new ChipObject();
				chip.gotoAndStop(1);
				chip.chipNumber.gotoAndStop(7);
				_chipMC.addChild(chip);
			}
			
			trace("2-----------",tempChipNum,"__");
			
			for(i = 0;i<_chipMC.numChildren;i++){
				_chipMC.getChildAt(i).y = -i*3;
			}
			
			_chipMC.addChild(numText);
			return _chipMC;
		}
		
		private var winChipNum:Number;//当前赢得筹码数
		//当前赢得筹码展示
		private function showNumChipWin():void{
			while(pointChipWin.numChildren>0){
				pointChipWin.removeChildAt(0);
			}
			SoundManager.instance.play("snd_chipPlace_soft");
			pointChipWin.addChild(chipMC(winChipNum));
		}
		
		
		//筹码点数显示
		private function pointTextShow(num:Number):Sprite{
			var spr:Sprite = new Sprite();
			spr.graphics.beginFill(0x323232,0.8);
			spr.graphics.drawRect(0,0,20,10);
			var txt:TextField = new TextField();
			txt.textColor = 0xffffff;
			txt.defaultTextFormat = _tf0;
			txt.text = num.toString();
			txt.width = 20;
			txt.y = -3;
			txt.autoSize = TextFieldAutoSize.CENTER;
			spr.addChild(txt);
			spr.x = -10;
			spr.y = 20;
			return spr;
		}
		
		private var isumeAct:Array;
		/**
		 * 保险结算时
		 **/
		public function mathIsumeOver(arr:Array):void{
			isumeAct = arr;
			addEventListener(Event.ENTER_FRAME,gameOverIsumeAct);
		}
		
		private function gameOverIsumeAct(e:Event):void{
			if(!_dealing){
				if(!isumeAct) return;
				if(isumeAct.length>0){
					isumBoxArray[isumeAct[0].circleUnitID].isumAction(isumeAct[0].blackjack);
					isumeAct.splice(0,1);
				}else if(isumeAct.length == 0){
					removeEventListener(Event.ENTER_FRAME,gameOverIsumeAct);
					setTimeout(sendGameOver,1000);
				}
			}
		}
		
		//请求结算游戏
		private function sendGameOver():void{
			var tempArr:Array = new Array();
			for(var i:int = 0;i<cardChipBoxArray.length;i++){
				if(cardChipBoxArray[i].cardArrayLenth>0 && cardChipBoxArray[i].cardNum<=21) tempArr.push(i);
				trace(cardPartBoxArray.length,"~~",i);
				if(cardPartBoxArray[i+1].cardArrayLenth>0 && cardPartBoxArray[i+1].cardNum<=21) tempArr.push(i+6);
			}
			BlackJack.cardGameSocketSender.oneIsumeOverPack(tempArr);
		}
		
		private var gameOverVect:Array;
		private var _closeDealing:Boolean;
		/**
		 * 游戏结算
		 **/
		public function mathGameOver(arr:Array):void{
			gameOverVect = arr;
			_closeDealing = false;
			setTimeout(beginCheckGameOver,2000);
		}
		//开始检查游戏结束结算动画（延迟检测防止最后一副牌爆牌动画未播放完）
		private function beginCheckGameOver():void{
			addEventListener(Event.ENTER_FRAME,gameOverAct);
			trace("addEventListener(Event.ENTER_FRAME,gameOverAct);");
		}
		
		private function gameOverAct(e:Event):void{
			if(!_dealing && !_closeDealing){
				if(!gameOverVect) return;
				if(gameOverVect.length>0){
					var tempChipNum:Number = 0;
//					isumBoxArray[gameOverVect[0].circleUnitID].initIsume();
					if(gameOverVect[0].lost == 0){//输
						_closeDealing = true;
						if(gameOverVect[0].circleUnitID <=4){
							cardChipBoxArray[gameOverVect[0].circleUnitID].closeCard();
							SoundManager.instance.play("dealer_wins");
						}else if(gameOverVect[0].circleUnitID >=6 || gameOverVect[0].circleUnitID <= 10){
							cardPartBoxArray[gameOverVect[0].circleUnitID-5].closeCard();
							SoundManager.instance.play("dealer_wins");
						}
					}else if(gameOverVect[0].lost == 1){//赢
						_closeDealing = true;
						if(gameOverVect[0].circleUnitID <=4){
							tempChipNum = cardChipBoxArray[gameOverVect[0].circleUnitID].chipNum;
							trace("gameOverVect[0].chips - cardChipBoxArray[0].chipNum",gameOverVect[0].chips,cardChipBoxArray[gameOverVect[0].circleUnitID].chipNum);
							cardChipBoxArray[gameOverVect[0].circleUnitID].closeCard1();
							//								if(gameOverVect[0].chips - cardChipBoxArray[0].chipNum>0) bankerChipPay(gameOverVect[0].chips - cardChipBoxArray[0].chipNum);
							SoundManager.instance.play("player_wins.wav");
							setTimeout(bankerChipPay,400,gameOverVect[0].chips-tempChipNum);
						}else if(gameOverVect[0].circleUnitID >=6 || gameOverVect[0].circleUnitID <= 10){
							tempChipNum = cardPartBoxArray[gameOverVect[0].circleUnitID-5].chipNum;
							trace("gameOverVect[0].chips - cardChipBoxArray[0].chipNum",gameOverVect[0].chips,cardPartBoxArray[gameOverVect[0].circleUnitID-5].chipNum);
							cardPartBoxArray[gameOverVect[0].circleUnitID-5].closeCard1();
							//								if(gameOverVect[0].chips - cardChipBoxArray[0].chipNum>0) bankerChipPay(gameOverVect[0].chips - cardChipBoxArray[0].chipNum);
							SoundManager.instance.play("player_wins.wav");
							setTimeout(bankerChipPay,400,gameOverVect[0].chips-tempChipNum);
						}
					}else if(gameOverVect[0].lost == 2){
						_closeDealing = true;
						if(gameOverVect[0].circleUnitID <=4){
							cardChipBoxArray[gameOverVect[0].circleUnitID].closeCard1();
							SoundManager.instance.play("push.wav");
						}else if(gameOverVect[0].circleUnitID >=6 || gameOverVect[0].circleUnitID <= 10){
							cardPartBoxArray[gameOverVect[0].circleUnitID-5].closeCard1();
							SoundManager.instance.play("push.wav");
						}
					}
					gameOverVect.splice(0,1);
				}else if(gameOverVect.length == 0){
					cardPartBoxArray[0].closeCard();
					removeEventListener(Event.ENTER_FRAME,gameOverAct);
					setTimeout(nextGame,2500);
				}
			}
		}
		
		//进入下一把
		private function nextGame():void{
			_inOneGame = false;
			gameStateChange(4);
		}
		
		/**
		 * 可买保险
		 **/
		public function canIsume():void{
			needIsumeTip = true;
		}
		
		/**
		 * 设置账户余额
		 **/
		public function set roleMoney(num:int):void{
			buyChipUI.cmdMoney.text = num.toString();
		}
		
		//判断是否提示买保险
		private function checkIsume():Boolean{
			if(needIsumeTip){
				if(_tipOfIsumAllPanel){//第一次提示买保险
					showIsumAllPanel();
					_tipOfIsumAllPanel = false;
				}else{
					if(_allBuyIsum == 0){
						if(_tipOfIsumPanel){//需要提示
							showIsumPanel();
						}
					}if(_allBuyIsum == 1){//全部买保险
						bayIsume();
//						checkCanPack();
					}if(_allBuyIsum == 2){//全部不买保险
//						checkCanPack();
					}
				}
			}
			return _tipOfIsumAllPanel;
		}
		
		/**
		 * 买保险
		 **/
		public function bayIsume():void{
			trace("cardChipBoxArray[_callCardNum].chipNum",cardChipBoxArray[_callCardNum].chipNum);
			if(cardChipBoxArray[_callCardNum].chipNum/2 > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return;
			}
			isumBoxArray[_callCardNum].addChip(cardChipBoxArray[_callCardNum].chipNum/2);
			BlackJack.cardGameSocketSender.insumePack(_callCardNum);
		}
		
		/**
		 * 不买保险
		 **/
		public function notBayIsume():void{
			BlackJack.cardGameSocketSender.noInsumePack(_callCardNum);
		}
		
		/**
		 * 全部买保险
		 **/
		public function bayAllIsume():void{
			var tempNum:Number = 0;
			for(var i:int = 0;i<isumBoxArray.length;i++){
				tempNum += cardChipBoxArray[i].chipNum/2;
			}
			if(tempNum > Number(tittle.txtMoney.text)){
				InfoPanel.getInstance().showInfo(1);
				return;
			}
			for(i = 0;i<isumBoxArray.length;i++){
				isumBoxArray[i].addChip(cardChipBoxArray[i].chipNum/2);
			}
			BlackJack.cardGameSocketSender.allInsumePack();
		}
		
		/**
		 * 全部不买保险
		 **/
		public function allNotBayIsume():void{
			BlackJack.cardGameSocketSender.allNoInsumePack();
		}
		
		/**
		 * 保险位置更新
		 **/
		public function resetIsumeArrow(index:int):void{
			cardChipBoxArray[_callCardNum].closeCallCardArrow();
			_callCardNum = index;
			cardChipBoxArray[_callCardNum].showCallCardArrow();
			checkIsume();
		}
		
		/**
		 * 所有玩家保险筹码添加
		 **/
		public function addAllIsumChip(arr:Array):void{
			for each(var obj:Object in arr){
				isumBoxArray[obj.circleUnitID].addChip(obj.chips);
			}
		}
		
//		/**
//		 * 检测是否能分牌
//		 **/
//		public function checkCanPack():void{
//			cardChipBoxArray[_callCardNum].checkPack();
//		}
//		
//		public function bayAllIsume():void{
//			
//		}

		/**
		 * 当前总下注筹码数
		 **/
		public function get allChipNum():Number
		{
			return _allChipNum;
		}

		/**
		 * 当前总下注筹码数
		 **/
		public function set allChipNum(value:Number):void
		{
			_allChipNum = value;
			BlackJack._gameUi.tittle.cmdAllChip.text = _allChipNum.toString();
		}
		
		//提示框相关----------------------------------------------------------------------
		/**
		 * 弹出确认叫牌提示框
		 **/
		public function showSurePanel():void{
			SoundManager.instance.play("errorMessage");
			pointPanel.addChild(surePanel);
			_showPanel = true;
		}
		
		public function closeSurePanel():void{
			if(pointPanel.contains(surePanel)) pointPanel.removeChild(surePanel);
			_showPanel = false;
		}
		
		/**
		 * 第一次弹出买保险提示框
		 **/
		public function showIsumPanel():void{
			SoundManager.instance.play("insurance");
			pointPanel.addChild(isumPanel);
			_showPanel = true;
		}
		
		public function closeIsumPanel():void{
			if(pointPanel.contains(isumPanel)) pointPanel.removeChild(isumPanel);
			_showPanel = false;
		}
		
		/**
		 * 弹出买保险提示框
		 **/
		public function showIsumAllPanel():void{
			SoundManager.instance.play("insurance");
			pointPanel.addChild(isumAllPanel);
			_showPanel = true;
		}
		
		public function closeIsumAllPanel():void{
			if(pointPanel.contains(isumAllPanel)) pointPanel.removeChild(isumAllPanel);
			_showPanel = false;
			gameStateChange(2);
		}
		//-------------------------------------------------------------------------------

//		public function get callCardNum():int
//		{
//			return _callCardNum;
//		}
//
//		public function set callCardNum(value:int):void
//		{
//			_callCardNum = value;
//			if(chipCallList.length>_callCardNum && cardChipBoxArray[chipCallList[_callCardNum]]) cardChipBoxArray[chipCallList[_callCardNum]].showCallCardArrow();
//		}

		/**
		 * 是否正在发牌
		 **/
		public function dealing(value:Boolean,isBanker:Boolean,length:int,cardNum:int):void
		{
			_dealing = value;
			if(!value && !isBanker){
				if(length == 2){
//					gameStateChange(2);
				}else if(length > 2){
					if(cardNum<21) gameStateChange(6);
				}
			}
		}
		
		/**
		 * 是否正在收牌
		 **/
		public function closeDealing(value:Boolean):void
		{
			_closeDealing = value;
		}


		/**
		 * 当局是否提示大于等于17点
		 **/
		public function set tipOfSurePanel(value:Boolean):void
		{
			_tipOfSurePanel = value;
		}

		/**
		 * 当局是否已经提示全部买保险
		 **/
		public function set tipOfIsumAllPanel(value:Boolean):void
		{
			_tipOfIsumAllPanel = value;
		}

		/**
		 * 当局是否提示买保险
		 **/
		public function set tipOfIsumPanel(value:Boolean):void
		{
			_tipOfIsumPanel = value;
		}

		/**
		 * 是否全部买保险
		 **/
		public function set allBuyIsum(value:int):void
		{
			_allBuyIsum = value;
		}

		public function get partCardOver():Boolean
		{
			return _partCardOver;
		}

		public function set partCardOver(value:Boolean):void
		{
			_partCardOver = value;
		}

		public function get isDealingOver():Boolean
		{
			return _isDealingOver;
		}

		public function set tipsIsum(value:Boolean):void
		{
			_tipsIsum = value;
			if(!value && _inOneGame && needIsumeTip){
				if(_tipOfIsumAllPanel || _tipOfIsumPanel){
					BlackJack.cardGameSocketSender.elseNoInsumePack();
					if(pointPanel.contains(isumAllPanel)) pointPanel.removeChild(isumAllPanel);
					if(pointPanel.contains(isumPanel)) pointPanel.removeChild(isumPanel);
				}
			}
		}

		public function get tipsIsum():Boolean
		{
			return _tipsIsum;
		}

		public function set inOneGame(value:Boolean):void
		{
			_inOneGame = value;
		}

		public function get callCardNum():int
		{
			return _callCardNum;
		}

		
	//-----------------------------------------------------------------------------------	
	}
}